#include "stdafx.h"
#include "OperateOccObject.h"


OperateOccObject::OperateOccObject(QObject *parent ) : OccObjectBase(parent)
{
}


OperateOccObject::~OperateOccObject()
{
}

QVariant OperateOccObject::VectorAdd(const gp_Vec& vec1, const gp_Vec& vec2)
{
	return ToVariant(vec1 + vec2);
}

QVariant OperateOccObject::VectorSub(const gp_Vec& vec1, const gp_Vec& vec2)
{
	return ToVariant(vec1 - vec2);

}

ZMReal OperateOccObject::VectorPointMul(const gp_Vec& vec1, const gp_Vec& vec2)
{
	return vec1*vec2;
}

QVariant OperateOccObject::VectorCrossMul(const gp_Vec& vec1, const gp_Vec& vec2)
{
	return ToVariant(vec1^vec2);
}

QVariant OperateOccObject::VectorMul(const gp_Vec& vec1, const ZMReal& fNum)
{
	return ToVariant(vec1*fNum);
}

QVariant OperateOccObject::PointAdd(const gp_Pnt& pnt, const gp_Vec& vec2)
{
	gp_Vec vec1(pnt.X(), pnt.Y(), pnt.Z());
	return ToVariant(vec1 + vec2);
}

QVariant OperateOccObject::TransMul(const gp_Trsf& trsf1, const gp_Trsf& trsf2)
{
	return ToVariant(trsf1 * trsf2);
}
